<template>
	<view>
	
		<view class="rule-box">
			<image class="rule-img" mode="widthFix" @click="showAgreement(2)" src="https://web.78keji.cn/images/youku/guize.png">
			</image>
			<image class="rule-img" mode="widthFix" @click="telMobile" src="https://web.78keji.cn/images/youku/kefu.png"></image>
			<image class="rule-img" mode="widthFix" @click="gotoQuanyi" src="https://web.78keji.cn/images/youku/quanyis.png"></image>
		</view>
		<view v-if="isShowRule" class="rule-content-box">
			<image @click="isShowRule = false" class="rule-img" mode="widthFix" :src="baseImagePath + 'rule.png'"></image>
		</view>
	</view>
</template>

<script>
	import zfbUrlUtil from "../../utils/zfbUrlUtil";
	export default {
		data() {
			return {
				isShowRule: false,
			};
		},
		props: ['baseImagePath'],
		methods: {
			telMobile() {
				uni.makePhoneCall({
					phoneNumber: '4008825010'
				})
			},
			gotoQuanyi() {
			if(uni.getStorageSync('mobile')){
			let url = zfbUrlUtil.wrapUrl('https://web.78keji.cn/newlq/#/?mobile='+uni.getStorageSync('mobile'))
						
			my.ap.openURL({
				url: url,
				success: (res) => {
					console.log('openURL success', res)
				},
				fail: (err) => {
					console.log('openURL success', err)
				}
			});
			}else{
				uni.showToast({
					title: '请先获取手机号',
					icon: 'none', //将值设置为 success 或者 ''
					duration: 2000 //持续时间为 2秒
				})
			}
			},
			showAgreement(value){
				this.$emit('showAgreement',value)
			}
		}
	}
</script>

<style lang="scss">
	.rule-box {
		position: fixed;
		top: 200rpx;
		right: 0;
	
		.rule-img {
			width: 52rpx;
			height: auto;
			margin-bottom: 20rpx;
			display: block;
		}
	}
	
	
	.rule-content-box {
		position: fixed;
		width: 100%;
		height: 100vh;
		left: 0;
		top: 0;
		overflow: auto;
		z-index: 9;
	
		.rule-img {
			width: 100%;
			height: auto;
		}
	}
</style>